package demo2;

import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        double[][] nums = new double[n+1][2];
        for(int i = 1;i <= n;i++){
            nums[i][0] = i;
            double a = scanner.nextDouble();
            double b = scanner.nextDouble();
            double val = a/(a+b);
            nums[i][1] = val;
        }
        nums[0][1] = Double.MAX_VALUE;
        Arrays.sort(nums,(a,b)->{
            if(b[1]>a[1]){
                return 1;
            }else if(b[1]==a[1]){
                return 1;
            }else return -1;
            //return (int)(b[1]-a[1]);
        });
        for(int i = 1;i<=n;i++){
            System.out.printf("%.0f",nums[i][0]);
            if(i!=n)
            {System.out.print(" ");}
        }
    }
}


